package com.kawaiior.asoulworld.util;

import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

import java.util.List;

public class WorldHelper {
    public static void createLootDrop(List<ItemStack> drops, World world, BlockPos pos) {
        createLootDrop(drops, world, pos.getX(), pos.getY(), pos.getZ());
    }

    public static void createLootDrop(List<ItemStack> drops, World world, double x, double y, double z) {
        ItemHelper.compactItemListNoStacksize(drops);

        for (ItemStack drop : drops)
        {
            EntityItem ent = new EntityItem(world, x, y, z);
            ent.setItem(drop);
            world.spawnEntity(ent);
        }
    }
}
